<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
[#include "/admin/include/head.htm"]

    <script type="text/javascript">


        function f_config(){
            var selecteds = grid.getSelecteds();
            if (selecteds.length != 1) {
                LG.tip('请选择一行记录!');
                return;
            }
            window.location.href =  base+'/admin/payment/detail.aspx?id='+selecteds[0].id;
        }
        /**
         * 商品上架
         */
        function f_open() {
            var selecteds = grid.getSelecteds();
            if (selecteds.length > 0) {

                    if (confirm){
                        LG.ajax({
                            url: base + '/admin/payment/modify.aspx',
                            loading: '正在改变中...',
                            data: { id: selecteds[0].id  },
                            success: function () {
                                LG.showSuccess('操作成功!');
                                f_reload();
                            },
                            error: function (message) {
                                LG.showError(message);
                            }
                        });
                    }

            } else {
                LG.tip('请选择行!');
            }
        }


        $(function(){
            grid = $("#maingrid").ligerGrid({
                columns: [

                    {display: '支付类型', name: 'style', align: 'center', width: 200 ,dict:"recharge_methods"},
                    {display: '支付名称', name: 'name', align: 'center', width: 200 },
                    {display: 'id', name: 'id', align: 'center', width: 200,frozen:"true" },
                    {display: '详细描述', name: 'description', align: 'center', width: 200 },
                    {display: '状态', name: 'status', align: 'center', width: 200,
                        render: function(row){
                            if(row.status==1){
                               return "开启";
                            }else{
                                return "关闭";
                            }
                    }}

                ],  pageSize:20, url: 'queryData.aspx',toolbar: {}, width: '100%', height:'100%', enabledSort: true
            });

            $(".l-toolbar").ligerToolBar({ items: [

                { text: '改变状态', click: f_open },

                { line:true },

                { text: '配置', click: f_config },
            ]
            });

            LG.search(grid);
        });

    </script>
</head>
<body style="padding:10px; overflow:hidden;">
<div id="functions">
    <div class="clearfix">

    </div>
</div>

<div id="maingrid" style="margin:0; padding:0"></div>
</body>
</html>